package com.test.study.ToolsUtils.strom.drpc;

import java.util.Map;

import org.apache.storm.thrift.TException;
import org.apache.storm.thrift.transport.TTransportException;
import org.apache.storm.utils.DRPCClient;
import org.apache.storm.utils.Utils;

public class DrcpClientMain  {
	private static final String IP="127.0.0.1";
	private static final int PORT=3772;

	@SuppressWarnings({ "resource", "rawtypes" })
	public static void main(String[] args) throws TTransportException {
		try {
			Map config = Utils.readDefaultConfig();//这行必须有 不然会报空指针
			//连接Drcp客户端
			DRPCClient drcpClient=new DRPCClient(config, IP,PORT);
			//调用远程服务器
			String execute = drcpClient.execute("fun", "我是胡勇");
			System.out.println(execute);
		} catch (TException e) {
			e.printStackTrace();
		}
	}

}
